package com.mission.schedule.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.text.TextUtils;
import android.util.Log;

import com.android.volley.AuthFailureError;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request.Method;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.google.gson.Gson;
import com.mission.schedule.activity.NewFriendsActivity;
import com.mission.schedule.applcation.App;
import com.mission.schedule.bean.DownLoadRepeatBackBean;
import com.mission.schedule.bean.DownLoadRepeatBean;
import com.mission.schedule.bean.RepeatBean;
import com.mission.schedule.bean.RepeatUpAndDownBean;
import com.mission.schedule.clock.QueryAlarmData;
import com.mission.schedule.clock.RepeatDateUtil;
import com.mission.schedule.constants.ShareFile;
import com.mission.schedule.constants.URLConstants;
import com.mission.schedule.entity.CLRepeatTable;
import com.mission.schedule.utils.CalendarChangeValue;
import com.mission.schedule.utils.DateUtil;
import com.mission.schedule.utils.NetUtil;
import com.mission.schedule.utils.RepeatDateUtils;
import com.mission.schedule.utils.SharedPrefUtil;
import com.mission.schedule.utils.StringUtils;
import com.mission.schedule.utils.XmlUtil;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 下载重复日程
 * Created by liwei on 2017/4/7.
 */

public class DownRepeatService extends Service {

    public static final String RepUPDATADATA = "repUpdateData";
    App application = App.getDBcApplication();
    String downreppath = "";
    SharedPrefUtil sharedPrefUtil = null;
    boolean isZhuanFaDown = false;
    String UserId = "";
    String schyear;
    String schtime;
    String repyear;
    String reptime;
    List<Map<String, String>> soundlist = new ArrayList<Map<String, String>>();
    CalendarChangeValue changeValue = new CalendarChangeValue();

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {

        soundlist.clear();
        soundlist = XmlUtil.readBeforeBellXML(this);
        if (intent != null) {
            downreppath = intent.getStringExtra("downreppath");
        }

        sharedPrefUtil = new SharedPrefUtil(getApplication(), ShareFile.USERFILE);
        UserId = sharedPrefUtil.getString(getApplicationContext(),
                ShareFile.USERFILE, ShareFile.USERID, "");
        String date = DateUtil.formatDateTimeSs(new Date());
        int year1 = Integer.parseInt(date.substring(0, 4)
                .toString()) - 1;
        if ("0".equals(sharedPrefUtil.getString(getApplication(),
                ShareFile.USERFILE, ShareFile.FIRSTLOGIN, "0"))) {
            schyear = String.valueOf(year1)
                    + date.substring(4, 10).toString();
            schtime = date.substring(11, 19).toString();
            repyear = String.valueOf(year1)
                    + date.substring(4, 10).toString();
            reptime = date.substring(11, 19).toString();
        } else {
            String schdate = sharedPrefUtil.getString(
                    getApplication(), ShareFile.USERFILE,
                    ShareFile.DOWNSCHTIME, "");
            if (!"".equals(schdate)) {
                try {
                    schyear = schdate.substring(0, 10);
                    schtime = schdate.substring(11);
                } catch (Exception e) {
                    schyear = DateUtil.formatDate(new Date());
                    schtime = DateUtil.formatDateTimeSs(new Date()).substring(11);
                }
            } else {
                schyear = String.valueOf(year1)
                        + date.substring(4, 10).toString();
                schtime = date.substring(11, 19).toString();
            }
            String repdate = sharedPrefUtil.getString(
                    getApplication(), ShareFile.USERFILE,
                    ShareFile.DOWNREPTIME, "");
            if (!"".equals(repdate)) {
                try {
                    repyear = repdate.substring(0, 10);
                    reptime = repdate.substring(11);
                } catch (Exception e) {
                    repyear = DateUtil.formatDate(new Date());
                    reptime = DateUtil.formatDateTimeSs(new Date()).substring(11);
                }
            } else {
                repyear = String.valueOf(year1)
                        + date.substring(4, 10).toString();
                reptime = date.substring(11, 19).toString();
            }
        }
        if (downreppath == null) {
            downreppath = URLConstants.重复数据下载 + "?cUid=" + UserId + "&beforDownTime=" + repyear + "&time=" + reptime;
        } else {
            isZhuanFaDown = true;
        }
//        System.out.println("重复下载:" + downreppath);
        if (sharedPrefUtil.getString(getApplication(), ShareFile.USERFILE, ShareFile.ISNEWYOUKE, "0").equals("-1")) {

            if (isZhuanFaDown) {
                StringRequest request = new StringRequest(Method.GET, downreppath,
                        new Response.Listener<String>() {

                            @Override
                            public void onResponse(final String result) {
                                if (!TextUtils.isEmpty(result)) {
                                    new Thread(new Runnable() {

                                        @Override
                                        public void run() {
                                            try {
                                                Gson gson = new Gson();
                                                DownLoadRepeatBack downLoadBean;
                                                downLoadBean = gson.fromJson(result, DownLoadRepeatBack.class);

                                                List<DownLoadRepeatBack.ListBean> list;
                                                if (downLoadBean.status == 0) {
                                                    sharedPrefUtil.putString(
                                                            getApplication(),
                                                            ShareFile.USERFILE,
                                                            ShareFile.DOWNREPTIME,
                                                            downLoadBean.message.replace("T", " "));

                                                    list = downLoadBean.list;
                                                    if (list != null && list.size() > 0) {
                                                        for (int i = 0; i < list.size(); i++) {

                                                            String ringcode = "";
                                                            String ringdesc = "";
                                                            for (int j = 0; j < soundlist.size(); j++) {
                                                                String str = list.get(i).repRingCode.replace(".ogg", "");
                                                                if (str.equals(soundlist.get(j).get("value"))) {
                                                                    ringcode = soundlist.get(j).get("value");
                                                                    ringdesc = soundlist.get(j).get("name");
                                                                    break;
                                                                } else {
                                                                    ringcode = "g_88";
                                                                    ringdesc = "完成任务";
                                                                }
                                                            }
                                                            int index = list.get(i).recommendedUserId;
                                                            // 根据repid查询重复表，看下是否有repid相同的母记事
                                                            int count = application.CheckCountRepData(list.get(i).repId);
                                                            if (count == 0) {
                                                                if (("".equals(list.get(i).repTypeParameter) || "null".equals(list.get(i).repTypeParameter))
                                                                        && (!"1".equals(list.get(i).repType) || !"5".equals(list.get(i).repType))) {
                                                                    application.insertDownCLRepeatTableData(
                                                                            list.get(i).repId,
                                                                            list.get(i).repBeforeTime,
                                                                            list.get(i).repColorType,
                                                                            list.get(i).repDisplayTime,
                                                                            list.get(i).repType,
                                                                            list.get(i).repIsAlarm,
                                                                            list.get(i).repIsPuase,
                                                                            list.get(i).repIsImportant,
                                                                            list.get(i).repSourceType,
                                                                            0,
                                                                            list.get(i).repTypeParameter,
                                                                            list.get(i).repNextCreatedTime.replace("T", " "),
                                                                            list.get(i).repLastCreatedTime.replace("T", " "),
                                                                            list.get(i).repInitialCreatedTime.replace("T", " "),
                                                                            list.get(i).repStartDate.replace("T", " "),
                                                                            list.get(i).repContent,
                                                                            list.get(i).repCreateTime.replace("T", " "),
                                                                            list.get(i).repSourceDesc,
                                                                            list.get(i).repSourceDescSpare,
                                                                            list.get(i).repTime,
                                                                            ringdesc,
                                                                            ringcode,
                                                                            list.get(i).repUpdateTime.replace("T", " "),
                                                                            list.get(i).repOpenState,
                                                                            list.get(i).recommendedUserName,
                                                                            index,
                                                                            list.get(i).repdateone,
                                                                            list.get(i).repdatetwo,
                                                                            list.get(i).repstateone,
                                                                            list.get(i).repstatetwo,
                                                                            list.get(i).aType,
                                                                            list.get(i).webUrl,
                                                                            list.get(i).imgPath,
                                                                            list.get(i).repInSTable,
                                                                            list.get(i).repEndState,
                                                                            list.get(i).parReamrk,
                                                                            list.get(i).repRead, 0
                                                                            , list.get(i).dataType, list.get(i).dataId, list.get(i).remark1,
                                                                            list.get(i).remark2, list.get(i).remark3, list.get(i).remark4, list.get(i).remark5);
                                                                } else {
                                                                    /**
                                                                     * 重复 每年
                                                                     */
                                                                    String parstr = "";
                                                                    if ("6".equals(list.get(i).repType)) {
                                                                        if (changeValue.changaSZ(list.get(i).repTypeParameter
                                                                                .replace("[", "")
                                                                                .replace("]", "")
                                                                                .replace("\n\"", "")
                                                                                .replace("\n", "")
                                                                                .replace("\"", ""))
                                                                                .length() == 2) {
                                                                            parstr = DateUtil.formatDate(new Date()).substring(5, 7)
                                                                                    + "-"
                                                                                    + changeValue.changaSZ(list.get(i).repTypeParameter
                                                                                    .replace("[", "")
                                                                                    .replace("]", "")
                                                                                    .replace("\n\"", "")
                                                                                    .replace("\n", "")
                                                                                    .replace("\"", ""));
                                                                        } else {
                                                                            parstr = changeValue.changaSZ(list.get(i).repTypeParameter
                                                                                    .replace("[", "")
                                                                                    .replace("]", "")
                                                                                    .replace("\n\"", "")
                                                                                    .replace("\n", "")
                                                                                    .replace("\"", ""));
                                                                        }
                                                                    }
                                                                    /**
                                                                     * 这里应该有判断
                                                                     */
                                                                    application.insertDownCLRepeatTableData(
                                                                            list.get(i).repId,
                                                                            list.get(i).repBeforeTime,
                                                                            list.get(i).repColorType,
                                                                            list.get(i).repDisplayTime,
                                                                            list.get(i).repType,
                                                                            list.get(i).repIsAlarm,
                                                                            list.get(i).repIsPuase,
                                                                            list.get(i).repIsImportant,
                                                                            list.get(i).repSourceType,
                                                                            0,
                                                                            list.get(i).repTypeParameter,
                                                                            list.get(i).repNextCreatedTime.replace("T", " "),
                                                                            list.get(i).repLastCreatedTime.replace("T", " "),
                                                                            list.get(i).repInitialCreatedTime.replace("T", " "),
                                                                            list.get(i).repStartDate.replace("T", " "),
                                                                            list.get(i).repContent,
                                                                            list.get(i).repCreateTime.replace("T", " "),
                                                                            list.get(i).repSourceDesc,
                                                                            list.get(i).repSourceDescSpare,
                                                                            list.get(i).repTime,
                                                                            ringdesc,
                                                                            ringcode,
                                                                            list.get(i).repUpdateTime.replace("T", " "),
                                                                            list.get(i).repOpenState,
                                                                            list.get(i).recommendedUserName,
                                                                            index,
                                                                            list.get(i).repdateone,
                                                                            list.get(i).repdatetwo,
                                                                            list.get(i).repstateone,
                                                                            list.get(i).repstatetwo,
                                                                            list.get(i).aType,
                                                                            list.get(i).webUrl,
                                                                            list.get(i).imgPath,
                                                                            list.get(i).repInSTable,
                                                                            list.get(i).repEndState,
                                                                            parstr,
                                                                            list.get(i).repRead, 0, list.get(i).dataType, list.get(i).dataId, list.get(i).remark1,
                                                                            list.get(i).remark2, list.get(i).remark3, list.get(i).remark4, list.get(i).remark5);
                                                                    application.updateRepeatStats(list.get(i).repId, 1);
                                                                }
                                                                //是否生成子记事标记 0 生成
                                                                if (list.get(i).repInSTable == 0) {
                                                                    //未暂停才生出
                                                                    if (list.get(i).repIsPuase == 0) {
                                                                        CreateRepeatSchNextData(list.get(i));
                                                                    }
                                                                }

                                                            }
                                                        }
                                                    }
                                                    QueryAlarmData.writeAlarm(getApplicationContext());
                                                    if ((list != null && list.size() > 0)) {
                                                        Intent intent = new Intent();
                                                        intent.setAction(RepUPDATADATA);
                                                        intent.putExtra("data", "success");
                                                        sendBroadcast(intent);
                                                    } else {
                                                        Intent intent = new Intent();
                                                        intent.setAction(RepUPDATADATA);
                                                        intent.putExtra("data", "fail");
                                                        sendBroadcast(intent);
                                                    }
                                                } else if (downLoadBean.status == 1) {
                                                    sharedPrefUtil.putString(
                                                            getApplication(),
                                                            ShareFile.USERFILE,
                                                            ShareFile.DOWNREPTIME,
                                                            downLoadBean.message.replace("T", " "));
                                                    Intent intent = new Intent();
                                                    intent.setAction(RepUPDATADATA);
                                                    intent.putExtra("data", "fail");
                                                    sendBroadcast(intent);
                                                } else {
                                                    Intent intent = new Intent();
                                                    intent.setAction(RepUPDATADATA);
                                                    intent.putExtra("data", "fail");
                                                    sendBroadcast(intent);
                                                }
                                            } catch (Exception e) {
                                                e.printStackTrace();
                                                Intent intent = new Intent();
                                                intent.setAction(RepUPDATADATA);
                                                intent.putExtra("data", "fail");
                                                sendBroadcast(intent);
                                            }
                                            postNoteData();
                                            isZhuanFaDown = false;
                                        }
                                    }).start();

                                }
                            }
                        }, new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                        stopSelf();
                        Intent intent = new Intent();
                        intent.setAction(RepUPDATADATA);
                        intent.putExtra("data", "fail");
                        sendBroadcast(intent);
                    }
                });
                request.setTag("downRepeat");
                request.setRetryPolicy(new DefaultRetryPolicy(10000, 1, 1.0f));
                App.getHttpQueues().add(request);
            }
        }
        return super.onStartCommand(intent, flags, startId);
    }


    /**
     * 本地通知是否下行了转发重复
     */
    private void postNoteData() {
        if (NetUtil.getConnectState(getApplication()) != NetUtil.NetWorkState.NONE) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    StringRequest stringRequest = new StringRequest(Method.POST, URLConstants.重复转发下载通知,
                            new Response.Listener<String>() {
                                @Override
                                public void onResponse(String result) {
                                }

                            }, new Response.ErrorListener() {
                        @Override
                        public void onErrorResponse(VolleyError volleyError) {
                            Log.d("TAG", "error:" + volleyError.toString());
                        }
                    }) {
                        @Override
                        protected Map<String, String> getParams() throws AuthFailureError {
                            Map<String, String> map = new HashMap<>();
                            map.put("cUid", UserId);// "52432"
                            return map;
                        }
                    };
                    stringRequest.setTag("postrepeat");
                    stringRequest.setRetryPolicy(new DefaultRetryPolicy(10000, 1, 1.0f));
                    App.queues.add(stringRequest);
                }
            }).start();
        }
    }


    /**
     * 创建重复的下一条日程
     *
     * @param list
     */
    public static void CreateRepeatSchNextData(RepeatUpAndDownBean list) {
        App app = App.getDBcApplication();
        RepeatBean bean;
        int recommendId;
        if (!"".equals(StringUtils.getIsStringEqulesNull(list.recommendedUserId))) {
            recommendId = Integer.parseInt(list.recommendedUserId);
        } else {
            recommendId = 0;
        }
        int coclor;
        if ("".equals(StringUtils.getIsStringEqulesNull(list.repColorType))) {
            coclor = 0;
        } else {
            coclor = Integer.parseInt(list.repColorType);
        }
        if (app.queryChildRepeatIsSave(list.repContent, list.repNextCreatedTime, list.repId) == false) {
            // app.deleteChildSch(list.repId);
            if ("1".equals(list.repType)) {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 1, "", "",list.repDisplayTime);
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(list.repIsAlarm),
                        Integer.parseInt(list.repBeforeTime),
                        Integer.parseInt(list.repDisplayTime), 0,
                        Integer.parseInt(list.repIsImportant), coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        Integer.parseInt(list.repId), bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(list.repOpenState), 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId, bean.repNextCreatedTime);
            } else if ("2".equals(list.repType)) {
                if ("".equals(StringUtils
                        .getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 2, "1", "",list.repDisplayTime);
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                            list.repTime,
                            2,
                            list.repTypeParameter.replace("[", "").replace("]", "")
                                    .replace("\n\"", "").replace("\n", "")
                                    .replace("\"", ""), "",list.repDisplayTime);
                }

                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(list.repIsAlarm),
                        Integer.parseInt(list.repBeforeTime),
                        Integer.parseInt(list.repDisplayTime), 0,
                        Integer.parseInt(list.repIsImportant), coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        Integer.parseInt(list.repId), bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(list.repOpenState), 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId, bean.repNextCreatedTime);
            } else if ("3".equals(list.repType)) {
                if ("".equals(StringUtils
                        .getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 3, "1", "",list.repDisplayTime);
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                            list.repTime,
                            3,
                            list.repTypeParameter.replace("[", "").replace("]", "")
                                    .replace("\n\"", "").replace("\n", "")
                                    .replace("\"", ""), "",list.repDisplayTime);
                }
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(list.repIsAlarm),
                        Integer.parseInt(list.repBeforeTime),
                        Integer.parseInt(list.repDisplayTime), 0,
                        Integer.parseInt(list.repIsImportant), coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        Integer.parseInt(list.repId), bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(list.repOpenState), 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId, bean.repNextCreatedTime);
            } else if ("4".equals(list.repType)) {
                if ("".equals(StringUtils
                        .getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 4, "01-01",
                            "0",list.repDisplayTime);
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                            list.repTime,
                            4,
                            list.repTypeParameter.replace("[", "").replace("]", "")
                                    .replace("\n\"", "").replace("\n", "")
                                    .replace("\"", ""), "0",list.repDisplayTime);
                }
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(list.repIsAlarm),
                        Integer.parseInt(list.repBeforeTime),
                        Integer.parseInt(list.repDisplayTime), 0,
                        Integer.parseInt(list.repIsImportant), coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        Integer.parseInt(list.repId), bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(list.repOpenState), 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId, bean.repNextCreatedTime);
            } else if ("6".equals(list.repType)) {
                if ("".equals(StringUtils.getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 4, "正月初一", "1",list.repDisplayTime);
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 4,
                            list.repTypeParameter.replace("[", "").replace("]", "").replace("\n\"", "").replace("\n", "").replace("\"", ""), "1",list.repDisplayTime);
                }

                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(list.repIsAlarm),
                        Integer.parseInt(list.repBeforeTime),
                        Integer.parseInt(list.repDisplayTime), 0,
                        Integer.parseInt(list.repIsImportant), coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        Integer.parseInt(list.repId), bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(list.repOpenState), 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId, bean.repNextCreatedTime);
            } else {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 5, "", "",list.repDisplayTime);
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(list.repIsAlarm),
                        Integer.parseInt(list.repBeforeTime),
                        Integer.parseInt(list.repDisplayTime), 0,
                        Integer.parseInt(list.repIsImportant), coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        Integer.parseInt(list.repId), bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(list.repOpenState), 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId, bean.repNextCreatedTime);
            }
        }

    }


    public static void CreateRepeatSchNextData(DownLoadRepeatBack.ListBean list) {
        App app = App.getDBcApplication();
        RepeatBean bean;
        int recommendId = list.recommendedUserId;
        int coclor = list.repColorType;
        // app.deleteChildSch(list.repId);
        if (app.queryChildRepeatIsSave(list.repContent, list.repNextCreatedTime, list.repId+"") == false) {
            if (list.repType == 1) {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 1, "", "",list.repDisplayTime+"");
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        list.repIsAlarm,
                        list.repBeforeTime,
                        list.repDisplayTime, 0,
                        list.repIsImportant, coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        list.repId, bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        list.repOpenState, 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId + "", bean.repNextCreatedTime);
            } else if ("2".equals(list.repType)) {
                if ("".equals(StringUtils
                        .getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 2, "1", "",list.repDisplayTime+"");
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                            list.repTime,
                            2,
                            list.repTypeParameter.replace("[", "").replace("]", "")
                                    .replace("\n\"", "").replace("\n", "")
                                    .replace("\"", ""), "",list.repDisplayTime+"");
                }

                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        list.repIsAlarm,
                        list.repBeforeTime,
                        list.repDisplayTime, 0,
                        list.repIsImportant, coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        list.repId, bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        list.repOpenState, 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId + "", bean.repNextCreatedTime);
            } else if ("3".equals(list.repType)) {
                if ("".equals(StringUtils
                        .getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 3, "1", "",list.repDisplayTime+"");
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                            list.repTime,
                            3,
                            list.repTypeParameter.replace("[", "").replace("]", "")
                                    .replace("\n\"", "").replace("\n", "")
                                    .replace("\"", ""), "",list.repDisplayTime+"");
                }
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        list.repIsAlarm,
                        list.repBeforeTime,
                        list.repDisplayTime, 0,
                        list.repIsImportant, coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        list.repId, bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        list.repOpenState, 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId + "", bean.repNextCreatedTime);
            } else if ("4".equals(list.repType)) {
                if ("".equals(StringUtils
                        .getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 4, "01-01",
                            "0",list.repDisplayTime+"");
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                            list.repTime,
                            4,
                            list.repTypeParameter.replace("[", "").replace("]", "")
                                    .replace("\n\"", "").replace("\n", "")
                                    .replace("\"", ""), "0",list.repDisplayTime+"");
                }
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        list.repIsAlarm,
                        list.repBeforeTime,
                        list.repDisplayTime, 0,
                        list.repIsImportant, coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        list.repId, bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        list.repOpenState, 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId + "", bean.repNextCreatedTime);
            } else if ("6".equals(list.repType)) {
                if ("".equals(StringUtils
                        .getIsStringEqulesNull(list.repTypeParameter))) {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 4, "正月初一",
                            "1",list.repDisplayTime+"");
                } else {
                    bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                            list.repTime,
                            4,
                            list.repTypeParameter.replace("[", "").replace("]", "")
                                    .replace("\n\"", "").replace("\n", "")
                                    .replace("\"", ""), "1",list.repDisplayTime+"");
                }

                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        list.repIsAlarm,
                        list.repBeforeTime,
                        list.repDisplayTime, 0,
                        list.repIsImportant, coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        list.repId, bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        list.repOpenState, 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId + "", bean.repNextCreatedTime);
            } else {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(list.repTime, 5, "", "",list.repDisplayTime+"");
                app.insertScheduleData(((list.repContent.length() > 2 &&
                                list.repContent.substring(0,2).equals("#%")) ?
                               list.repContent.substring(2, list.repContent.length()) :
                               list.repContent),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        list.repIsAlarm,
                        list.repBeforeTime,
                        list.repDisplayTime, 0,
                        list.repIsImportant, coclor, 0,
                        bean.repNextCreatedTime, "", 0, "", "",
                        list.repId, bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        list.repOpenState, 1, list.repRingDesc,
                        list.repRingCode, "", 0, 0, list.aType, list.webUrl,
                        list.imgPath, 0, 0, recommendId, 0, "","0","0");
                app.updateRepeatTimeNextDate(list.repId + "", bean.repNextCreatedTime);
            }
        }

    }

    public static void CreateRepeatSchNextData(Map<String, String> map) {
        App app = App.getDBcApplication();
        RepeatBean bean;
        if (app.queryChildRepeatIsSave(map.get(CLRepeatTable.repContent), map.get(CLRepeatTable.repNextCreatedTime), map.get(CLRepeatTable.repID)) == false) {
            if ("1".equals(map.get(CLRepeatTable.repType))) {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(map.get(CLRepeatTable.repTime), 1, "", "",map.get(CLRepeatTable.repDisplayTime));
                app.insertScheduleData(((map.get(CLRepeatTable.repContent).length() > 2 &&
                                map.get(CLRepeatTable.repContent).substring(0,2).equals("#%")) ?
                                map.get(CLRepeatTable.repContent).substring(2, map.get(CLRepeatTable.repContent).length()) :
                                map.get(CLRepeatTable.repContent)),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(map.get(CLRepeatTable.repIsAlarm)),
                        Integer.parseInt(map.get(CLRepeatTable.repBeforeTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repDisplayTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repSourceType)),
                        Integer.parseInt(map.get(CLRepeatTable.repIsImportant)),
                        Integer.parseInt(map.get(CLRepeatTable.repColorType)), 0,
                        bean.repNextCreatedTime, "", 0, map.get(CLRepeatTable.repSourceDesc), map.get(CLRepeatTable.repSourceDescSpare),
                        Integer.parseInt(map.get(CLRepeatTable.repID)),
                        bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(map.get(CLRepeatTable.repOpenState)), 1,
                        map.get(CLRepeatTable.repRingDesc),
                        map.get(CLRepeatTable.repRingCode), "", 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repAType)),
                        map.get(CLRepeatTable.repWebURL),
                        map.get(CLRepeatTable.repImagePath), 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repcommendedUserId)), 0, "","0","0");
                app.updateRepeatTimeNextDate(map.get(CLRepeatTable.repID), bean.repNextCreatedTime);
            } else if ("2".equals(map.get(CLRepeatTable.repType))) {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                        map.get(CLRepeatTable.repTime),
                        2,
                        map.get(CLRepeatTable.repTypeParameter).replace("[", "")
                                .replace("]", "").replace("\n\"", "")
                                .replace("\n", "").replace("\"", ""), "",map.get(CLRepeatTable.repDisplayTime));
                app.insertScheduleData(((map.get(CLRepeatTable.repContent).length() > 2 &&
                                map.get(CLRepeatTable.repContent).substring(0,2).equals("#%")) ?
                                map.get(CLRepeatTable.repContent).substring(2, map.get(CLRepeatTable.repContent).length()) :
                                map.get(CLRepeatTable.repContent)),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(map.get(CLRepeatTable.repIsAlarm)),
                        Integer.parseInt(map.get(CLRepeatTable.repBeforeTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repDisplayTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repSourceType)),
                        Integer.parseInt(map.get(CLRepeatTable.repIsImportant)),
                        Integer.parseInt(map.get(CLRepeatTable.repColorType)), 0,
                        bean.repNextCreatedTime, "", 0, map.get(CLRepeatTable.repSourceDesc), map.get(CLRepeatTable.repSourceDescSpare),
                        Integer.parseInt(map.get(CLRepeatTable.repID)),
                        bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(map.get(CLRepeatTable.repOpenState)), 1,
                        map.get(CLRepeatTable.repRingDesc),
                        map.get(CLRepeatTable.repRingCode), "", 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repAType)),
                        map.get(CLRepeatTable.repWebURL),
                        map.get(CLRepeatTable.repImagePath), 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repcommendedUserId)), 0, "","0","0");
                app.updateRepeatTimeNextDate(map.get(CLRepeatTable.repID), bean.repNextCreatedTime);
            } else if ("3".equals(map.get(CLRepeatTable.repType))) {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                        map.get(CLRepeatTable.repTime),
                        3,
                        map.get(CLRepeatTable.repTypeParameter).replace("[", "")
                                .replace("]", "").replace("\n\"", "")
                                .replace("\n", "").replace("\"", ""), "",map.get(CLRepeatTable.repDisplayTime));
                app.insertScheduleData(((map.get(CLRepeatTable.repContent).length() > 2 &&
                                map.get(CLRepeatTable.repContent).substring(0,2).equals("#%")) ?
                                map.get(CLRepeatTable.repContent).substring(2, map.get(CLRepeatTable.repContent).length()) :
                                map.get(CLRepeatTable.repContent)),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(map.get(CLRepeatTable.repIsAlarm)),
                        Integer.parseInt(map.get(CLRepeatTable.repBeforeTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repDisplayTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repSourceType)),
                        Integer.parseInt(map.get(CLRepeatTable.repIsImportant)),
                        Integer.parseInt(map.get(CLRepeatTable.repColorType)), 0,
                        bean.repNextCreatedTime, "", 0, map.get(CLRepeatTable.repSourceDesc), map.get(CLRepeatTable.repSourceDescSpare),
                        Integer.parseInt(map.get(CLRepeatTable.repID)),
                        bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(map.get(CLRepeatTable.repOpenState)), 1,
                        map.get(CLRepeatTable.repRingDesc),
                        map.get(CLRepeatTable.repRingCode), "", 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repAType)),
                        map.get(CLRepeatTable.repWebURL),
                        map.get(CLRepeatTable.repImagePath), 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repcommendedUserId)), 0, "","0","0");
                app.updateRepeatTimeNextDate(map.get(CLRepeatTable.repID), bean.repNextCreatedTime);
            } else if ("4".equals(map.get(CLRepeatTable.repType))) {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                        map.get(CLRepeatTable.repTime),
                        4,
                        map.get(CLRepeatTable.repTypeParameter).replace("[", "")
                                .replace("]", "").replace("\n\"", "")
                                .replace("\n", "").replace("\"", ""), "0",map.get(CLRepeatTable.repDisplayTime));
                app.insertScheduleData(((map.get(CLRepeatTable.repContent).length() > 2 &&
                                map.get(CLRepeatTable.repContent).substring(0,2).equals("#%")) ?
                                map.get(CLRepeatTable.repContent).substring(2, map.get(CLRepeatTable.repContent).length()) :
                                map.get(CLRepeatTable.repContent)),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(map.get(CLRepeatTable.repIsAlarm)),
                        Integer.parseInt(map.get(CLRepeatTable.repBeforeTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repDisplayTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repSourceType)),
                        Integer.parseInt(map.get(CLRepeatTable.repIsImportant)),
                        Integer.parseInt(map.get(CLRepeatTable.repColorType)), 0,
                        bean.repNextCreatedTime, "", 0, map.get(CLRepeatTable.repSourceDesc), map.get(CLRepeatTable.repSourceDescSpare),
                        Integer.parseInt(map.get(CLRepeatTable.repID)),
                        bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(map.get(CLRepeatTable.repOpenState)), 1,
                        map.get(CLRepeatTable.repRingDesc),
                        map.get(CLRepeatTable.repRingCode), "", 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repAType)),
                        map.get(CLRepeatTable.repWebURL),
                        map.get(CLRepeatTable.repImagePath), 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repcommendedUserId)), 0, "","0","0");
                app.updateRepeatTimeNextDate(map.get(CLRepeatTable.repID), bean.repNextCreatedTime);
            } else if ("6".equals(map.get(CLRepeatTable.repType))) {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(
                        map.get(CLRepeatTable.repTime), 4,
                        map.get(CLRepeatTable.repTypeParameter).replace("[", "")
                                .replace("]", "").replace("\\", "").replace("\\", "").replace("\"", ""), "1",map.get(CLRepeatTable.repDisplayTime));
                app.insertScheduleData(((map.get(CLRepeatTable.repContent).length() > 2 &&
                                map.get(CLRepeatTable.repContent).substring(0,2).equals("#%")) ?
                                map.get(CLRepeatTable.repContent).substring(2, map.get(CLRepeatTable.repContent).length()) :
                                map.get(CLRepeatTable.repContent)),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(map.get(CLRepeatTable.repIsAlarm)),
                        Integer.parseInt(map.get(CLRepeatTable.repBeforeTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repDisplayTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repSourceType)),
                        Integer.parseInt(map.get(CLRepeatTable.repIsImportant)),
                        Integer.parseInt(map.get(CLRepeatTable.repColorType)), 0,
                        bean.repNextCreatedTime, "", 0, map.get(CLRepeatTable.repSourceDesc), map.get(CLRepeatTable.repSourceDescSpare),
                        Integer.parseInt(map.get(CLRepeatTable.repID)),
                        bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(map.get(CLRepeatTable.repOpenState)), 1,
                        map.get(CLRepeatTable.repRingDesc),
                        map.get(CLRepeatTable.repRingCode), "", 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repAType)),
                        map.get(CLRepeatTable.repWebURL),
                        map.get(CLRepeatTable.repImagePath), 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repcommendedUserId)), 0, "","0","0");
                app.updateRepeatTimeNextDate(map.get(CLRepeatTable.repID), bean.repNextCreatedTime);
            } else {
                bean = RepeatDateUtil.dateTimeToChildAlarmDate(map.get(CLRepeatTable.repTime), 5, "", "",map.get(CLRepeatTable.repDisplayTime));
                app.insertScheduleData(((map.get(CLRepeatTable.repContent).length() > 2 &&
                                map.get(CLRepeatTable.repContent).substring(0,2).equals("#%")) ?
                                map.get(CLRepeatTable.repContent).substring(2, map.get(CLRepeatTable.repContent).length()) :
                                map.get(CLRepeatTable.repContent)),
                        bean.repNextCreatedTime.substring(0, 10),
                        bean.repNextCreatedTime.substring(11, 16),
                        Integer.parseInt(map.get(CLRepeatTable.repIsAlarm)),
                        Integer.parseInt(map.get(CLRepeatTable.repBeforeTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repDisplayTime)),
                        Integer.parseInt(map.get(CLRepeatTable.repSourceType)),
                        Integer.parseInt(map.get(CLRepeatTable.repIsImportant)),
                        Integer.parseInt(map.get(CLRepeatTable.repColorType)), 0,
                        bean.repNextCreatedTime, "", 0, map.get(CLRepeatTable.repSourceDesc), map.get(CLRepeatTable.repSourceDescSpare),
                        Integer.parseInt(map.get(CLRepeatTable.repID)),
                        bean.repNextCreatedTime,
                        DateUtil.formatDateTimeSs(new Date()), 0,
                        Integer.parseInt(map.get(CLRepeatTable.repOpenState)), 1,
                        map.get(CLRepeatTable.repRingDesc),
                        map.get(CLRepeatTable.repRingCode), "", 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repAType)),
                        map.get(CLRepeatTable.repWebURL),
                        map.get(CLRepeatTable.repImagePath), 0, 0,
                        Integer.parseInt(map.get(CLRepeatTable.repcommendedUserId)), 0, "","0","0");
                app.updateRepeatTimeNextDate(map.get(CLRepeatTable.repID), bean.repNextCreatedTime);
            }
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        App.getHttpQueues().cancelAll("downRepeat");
        stopSelf();
    }

    class DownLoadRepeatBack {

        /**
         * message : 成功
         * status : 0
         * list : [{"aType":0,"repType":3,"recommendedUserId":52432,"repIsImportant":0,"cTags":"","imgPath":"","repOpenState":0,"repIsAlarm":1,"repRingCode":"g_88","recommendedUserName":"张力川","repChangeTime_two":"2000-01-01T00:00:00","repDisplayTime":1,"repstatetwo":3,"repChangeState":0,"repSourceType":0,"repUpdateTime":"2017-05-17T14:29:19","repIsPuase":0,"repEndState":1,"repTypeParameter":"[\"30\"]","repColorType":317,"tempId":null,"repUid":1140656,"repRingDesc":"完成任务","repdatetwo":"2016-05-30 11:00","repId":11,"repDecoupledState":0,"repEndState_two":0,"repSourceDesc":"","repInSTable":0,"repCreateTime":"2017-05-17T14:29:19","repDecoupledState_two":1,"parReamrk":"","repDeleteState":0,"repDeleteState_two":0,"repInitialCreatedTime":"2017-05-17 14:29","repdateone":"2017-03-30 11:00","repstateone":3,"repBeforeTime":0,"repContent":"整理团队考核情况，扣款提交给晶晶。","repLastCreatedTime":"2017-04-30 11:00","repRead":0,"repSourceDescSpare":"","repNextCreatedTime":"2017-05-30 11:00","repStartDate":"2016-05-30 11:00","webUrl":"","repTime":"11:00","repChangeTime":"2000-01-01T00:00:00"}]
         */

        public String message;
        public int status;
        public List<ListBean> list;

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public class ListBean {
            /**
             * aType : 0
             * repType : 3
             * recommendedUserId : 52432
             * repIsImportant : 0
             * cTags :
             * imgPath :
             * repOpenState : 0
             * repIsAlarm : 1
             * repRingCode : g_88
             * recommendedUserName : 张力川
             * repChangeTime_two : 2000-01-01T00:00:00
             * repDisplayTime : 1
             * repstatetwo : 3
             * repChangeState : 0
             * repSourceType : 0
             * repUpdateTime : 2017-05-17T14:29:19
             * repIsPuase : 0
             * repEndState : 1
             * repTypeParameter : ["30"]
             * repColorType : 317
             * tempId : null
             * repUid : 1140656
             * repRingDesc : 完成任务
             * repdatetwo : 2016-05-30 11:00
             * repId : 11
             * repDecoupledState : 0
             * repEndState_two : 0
             * repSourceDesc :
             * repInSTable : 0
             * repCreateTime : 2017-05-17T14:29:19
             * repDecoupledState_two : 1
             * parReamrk :
             * repDeleteState : 0
             * repDeleteState_two : 0
             * repInitialCreatedTime : 2017-05-17 14:29
             * repdateone : 2017-03-30 11:00
             * repstateone : 3
             * repBeforeTime : 0
             * repContent : 整理团队考核情况，扣款提交给晶晶。
             * repLastCreatedTime : 2017-04-30 11:00
             * repRead : 0
             * repSourceDescSpare :
             * repNextCreatedTime : 2017-05-30 11:00
             * repStartDate : 2016-05-30 11:00
             * webUrl :
             * repTime : 11:00
             * repChangeTime : 2000-01-01T00:00:00
             */

            public int aType;
            public int repType;
            public int recommendedUserId;
            public int repIsImportant;
            public String cTags;
            public String imgPath;
            public int repOpenState;
            public int repIsAlarm;
            public String repRingCode;
            public String recommendedUserName;
            public String repChangeTime_two;
            public int repDisplayTime;
            public int repstatetwo;
            public int repChangeState;
            public int repSourceType;
            public String repUpdateTime;
            public int repIsPuase;
            public int repEndState;
            public String repTypeParameter;
            public int repColorType;
            public Object tempId;
            public int repUid;
            public String repRingDesc;
            public String repdatetwo;
            public int repId;
            public int repDecoupledState;
            public int repEndState_two;
            public String repSourceDesc;
            public int repInSTable;
            public String repCreateTime;
            public int repDecoupledState_two;
            public String parReamrk;
            public int repDeleteState;
            public int repDeleteState_two;
            public String repInitialCreatedTime;
            public String repdateone;
            public int repstateone;
            public int repBeforeTime;
            public String repContent;
            public String repLastCreatedTime;
            public int repRead;
            public String repSourceDescSpare;
            public String repNextCreatedTime;
            public String repStartDate;
            public String webUrl;
            public String repTime;
            public String repChangeTime;
            public String dataType;
            public String dataId;
            public String remark1;
            public String remark2;
            public String remark3;
            public String remark4;
            public String remark5;

            public int getaType() {
                return aType;
            }

            public void setaType(int aType) {
                this.aType = aType;
            }

            public String getcTags() {
                return cTags;
            }

            public void setcTags(String cTags) {
                this.cTags = cTags;
            }

            public String getDataType() {
                return dataType;
            }

            public void setDataType(String dataType) {
                this.dataType = dataType;
            }

            public String getDataId() {
                return dataId;
            }

            public void setDataId(String dataId) {
                this.dataId = dataId;
            }

            public String getRemark1() {
                return remark1;
            }

            public void setRemark1(String remark1) {
                this.remark1 = remark1;
            }

            public String getRemark2() {
                return remark2;
            }

            public void setRemark2(String remark2) {
                this.remark2 = remark2;
            }

            public String getRemark3() {
                return remark3;
            }

            public void setRemark3(String remark3) {
                this.remark3 = remark3;
            }

            public String getRemark4() {
                return remark4;
            }

            public void setRemark4(String remark4) {
                this.remark4 = remark4;
            }

            public String getRemark5() {
                return remark5;
            }

            public void setRemark5(String remark5) {
                this.remark5 = remark5;
            }

            public int getAType() {
                return aType;
            }

            public void setAType(int aType) {
                this.aType = aType;
            }

            public int getRepType() {
                return repType;
            }

            public void setRepType(int repType) {
                this.repType = repType;
            }

            public int getRecommendedUserId() {
                return recommendedUserId;
            }

            public void setRecommendedUserId(int recommendedUserId) {
                this.recommendedUserId = recommendedUserId;
            }

            public int getRepIsImportant() {
                return repIsImportant;
            }

            public void setRepIsImportant(int repIsImportant) {
                this.repIsImportant = repIsImportant;
            }

            public String getCTags() {
                return cTags;
            }

            public void setCTags(String cTags) {
                this.cTags = cTags;
            }

            public String getImgPath() {
                return imgPath;
            }

            public void setImgPath(String imgPath) {
                this.imgPath = imgPath;
            }

            public int getRepOpenState() {
                return repOpenState;
            }

            public void setRepOpenState(int repOpenState) {
                this.repOpenState = repOpenState;
            }

            public int getRepIsAlarm() {
                return repIsAlarm;
            }

            public void setRepIsAlarm(int repIsAlarm) {
                this.repIsAlarm = repIsAlarm;
            }

            public String getRepRingCode() {
                return repRingCode;
            }

            public void setRepRingCode(String repRingCode) {
                this.repRingCode = repRingCode;
            }

            public String getRecommendedUserName() {
                return recommendedUserName;
            }

            public void setRecommendedUserName(String recommendedUserName) {
                this.recommendedUserName = recommendedUserName;
            }

            public String getRepChangeTime_two() {
                return repChangeTime_two;
            }

            public void setRepChangeTime_two(String repChangeTime_two) {
                this.repChangeTime_two = repChangeTime_two;
            }

            public int getRepDisplayTime() {
                return repDisplayTime;
            }

            public void setRepDisplayTime(int repDisplayTime) {
                this.repDisplayTime = repDisplayTime;
            }

            public int getRepstatetwo() {
                return repstatetwo;
            }

            public void setRepstatetwo(int repstatetwo) {
                this.repstatetwo = repstatetwo;
            }

            public int getRepChangeState() {
                return repChangeState;
            }

            public void setRepChangeState(int repChangeState) {
                this.repChangeState = repChangeState;
            }

            public int getRepSourceType() {
                return repSourceType;
            }

            public void setRepSourceType(int repSourceType) {
                this.repSourceType = repSourceType;
            }

            public String getRepUpdateTime() {
                return repUpdateTime;
            }

            public void setRepUpdateTime(String repUpdateTime) {
                this.repUpdateTime = repUpdateTime;
            }

            public int getRepIsPuase() {
                return repIsPuase;
            }

            public void setRepIsPuase(int repIsPuase) {
                this.repIsPuase = repIsPuase;
            }

            public int getRepEndState() {
                return repEndState;
            }

            public void setRepEndState(int repEndState) {
                this.repEndState = repEndState;
            }

            public String getRepTypeParameter() {
                return repTypeParameter;
            }

            public void setRepTypeParameter(String repTypeParameter) {
                this.repTypeParameter = repTypeParameter;
            }

            public int getRepColorType() {
                return repColorType;
            }

            public void setRepColorType(int repColorType) {
                this.repColorType = repColorType;
            }

            public Object getTempId() {
                return tempId;
            }

            public void setTempId(Object tempId) {
                this.tempId = tempId;
            }

            public int getRepUid() {
                return repUid;
            }

            public void setRepUid(int repUid) {
                this.repUid = repUid;
            }

            public String getRepRingDesc() {
                return repRingDesc;
            }

            public void setRepRingDesc(String repRingDesc) {
                this.repRingDesc = repRingDesc;
            }

            public String getRepdatetwo() {
                return repdatetwo;
            }

            public void setRepdatetwo(String repdatetwo) {
                this.repdatetwo = repdatetwo;
            }

            public int getRepId() {
                return repId;
            }

            public void setRepId(int repId) {
                this.repId = repId;
            }

            public int getRepDecoupledState() {
                return repDecoupledState;
            }

            public void setRepDecoupledState(int repDecoupledState) {
                this.repDecoupledState = repDecoupledState;
            }

            public int getRepEndState_two() {
                return repEndState_two;
            }

            public void setRepEndState_two(int repEndState_two) {
                this.repEndState_two = repEndState_two;
            }

            public String getRepSourceDesc() {
                return repSourceDesc;
            }

            public void setRepSourceDesc(String repSourceDesc) {
                this.repSourceDesc = repSourceDesc;
            }

            public int getRepInSTable() {
                return repInSTable;
            }

            public void setRepInSTable(int repInSTable) {
                this.repInSTable = repInSTable;
            }

            public String getRepCreateTime() {
                return repCreateTime;
            }

            public void setRepCreateTime(String repCreateTime) {
                this.repCreateTime = repCreateTime;
            }

            public int getRepDecoupledState_two() {
                return repDecoupledState_two;
            }

            public void setRepDecoupledState_two(int repDecoupledState_two) {
                this.repDecoupledState_two = repDecoupledState_two;
            }

            public String getParReamrk() {
                return parReamrk;
            }

            public void setParReamrk(String parReamrk) {
                this.parReamrk = parReamrk;
            }

            public int getRepDeleteState() {
                return repDeleteState;
            }

            public void setRepDeleteState(int repDeleteState) {
                this.repDeleteState = repDeleteState;
            }

            public int getRepDeleteState_two() {
                return repDeleteState_two;
            }

            public void setRepDeleteState_two(int repDeleteState_two) {
                this.repDeleteState_two = repDeleteState_two;
            }

            public String getRepInitialCreatedTime() {
                return repInitialCreatedTime;
            }

            public void setRepInitialCreatedTime(String repInitialCreatedTime) {
                this.repInitialCreatedTime = repInitialCreatedTime;
            }

            public String getRepdateone() {
                return repdateone;
            }

            public void setRepdateone(String repdateone) {
                this.repdateone = repdateone;
            }

            public int getRepstateone() {
                return repstateone;
            }

            public void setRepstateone(int repstateone) {
                this.repstateone = repstateone;
            }

            public int getRepBeforeTime() {
                return repBeforeTime;
            }

            public void setRepBeforeTime(int repBeforeTime) {
                this.repBeforeTime = repBeforeTime;
            }

            public String getRepContent() {
                return repContent;
            }

            public void setRepContent(String repContent) {
                this.repContent = repContent;
            }

            public String getRepLastCreatedTime() {
                return repLastCreatedTime;
            }

            public void setRepLastCreatedTime(String repLastCreatedTime) {
                this.repLastCreatedTime = repLastCreatedTime;
            }

            public int getRepRead() {
                return repRead;
            }

            public void setRepRead(int repRead) {
                this.repRead = repRead;
            }

            public String getRepSourceDescSpare() {
                return repSourceDescSpare;
            }

            public void setRepSourceDescSpare(String repSourceDescSpare) {
                this.repSourceDescSpare = repSourceDescSpare;
            }

            public String getRepNextCreatedTime() {
                return repNextCreatedTime;
            }

            public void setRepNextCreatedTime(String repNextCreatedTime) {
                this.repNextCreatedTime = repNextCreatedTime;
            }

            public String getRepStartDate() {
                return repStartDate;
            }

            public void setRepStartDate(String repStartDate) {
                this.repStartDate = repStartDate;
            }

            public String getWebUrl() {
                return webUrl;
            }

            public void setWebUrl(String webUrl) {
                this.webUrl = webUrl;
            }

            public String getRepTime() {
                return repTime;
            }

            public void setRepTime(String repTime) {
                this.repTime = repTime;
            }

            public String getRepChangeTime() {
                return repChangeTime;
            }

            public void setRepChangeTime(String repChangeTime) {
                this.repChangeTime = repChangeTime;
            }
        }
    }
}
